/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.sapra.dao;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
 *
 * @author ppratsc
 */
public class Periodo {
    public int index = 0;
    public Date ini = null;
    public Date fin = null;
    public Date dia_limite=null;
    public int diaspagar = 0;
    public int empresa=0;

    public Periodo(int i,Date in, Date fi,int dp,Date dl){
        index = i;
        ini = in;
        fin = fi;
        dia_limite=dl;
        //OJO: Varlidar el Calcular los dias a pagar en caso de que sea zero o nulo dias a pagar
        diaspagar = dp;
    }
    public int getDias(){
        
        return diaspagar;
    }
    
    @Override
    public String toString(){
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MMM-dd",new Locale("es"));
        return "Del "+format.format(ini)+" al "+ format.format(fin);
    }
}
